package com.heyige.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sensitive_words")
public class SensitiveWord {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @TableField("word")
    private String word;
    
    @TableField("category")
    private String category;
    
    @TableField("level")
    private Integer level = 1;
    
    @TableField("action")
    private String action = Action.REPLACE.name();
    
    @TableField("replacement")
    private String replacement = "***";
    
    @TableField("is_active")
    private Boolean isActive = true;
    
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
    
    public enum Action {
        REPLACE,    // 替换
        REJECT,     // 拒绝
        WARN        // 警告
    }
}